import bb.cascades 1.0


Container {
    id: pie_element
    
    property string pie_color
    property string pie_percent
    
    function set(colorname, item, percent){
//        pie_color = colorname;
        var colors = [Color.Red, Color.Blue, Color.Yellow, Color.Green, Color.Cyan, Color.Magenta, Color.Gray, Color.Transparent, Color.Black, Color.White] ;
        ctn_color.background = colors[colorname] ;
        pie_percent = item + " " + percent ;
        }
    
    layout: StackLayout {
        orientation: LayoutOrientation.LeftToRight
    }
    topPadding: 20
    
    Container {
        id: ctn_color
        background: Color.White
        minHeight: 100
        minWidth: 100
    }
    Container {
        leftPadding: 20
        verticalAlignment: VerticalAlignment.Center
        Label {
            text: pie_element.pie_percent
        }
    }
}

